package com.example.practical_training_projects.controller;

import com.example.practical_training_projects.entity.articles;
import com.example.practical_training_projects.entity.collect_articles;
import com.example.practical_training_projects.service.articles_classService;
import com.example.practical_training_projects.service.collect_articlesService;
import com.example.practical_training_projects.vo.vousercollectarticles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("collect")
public class collect_articlesController {
    @Autowired
    private collect_articlesService service;
    @PostMapping("addcollect")
    public java.lang.Integer insertcollect(Integer a_uid,Integer user_uid) {
        return service.insertcollect(a_uid,user_uid);
    }

    @GetMapping("checkcollect")
    public collect_articles checkcollect(Integer a_uid, Integer user_uid){
        return  service.checkcollect(a_uid,user_uid);
    }

  @GetMapping ("deletecollect")
  public Integer deletecollect(Integer a_uid, Integer user_uid){
        return service.deletecollect(a_uid,user_uid);
  }
 @GetMapping("checkusercollect")
 public List<vousercollectarticles> findusercollectarticles(Integer user_uid){
      return service.findusercollectarticles(user_uid);
}
}
